package dao

import (
	"context"
	"listenboos-common/db"
	"listenboos-common/db/gorms"
	"ucenter/model"
)

type VipConfigDao struct {
	conn *gorms.GormConn
}

func NewVipConfigDaoDao(db *db.ListenDB) *VipConfigDao {
	return &VipConfigDao{
		conn: gorms.New(db.Conn),
	}
}
func (u *VipConfigDao) FindAll(ctx context.Context) (vipConfigs []*model.VipServiceConfig, err error) {
	session := u.conn.Session(ctx)
	err = session.Model(&model.VipServiceConfig{}).Find(&vipConfigs).Error
	if err != nil {
		return nil, err
	}
	return vipConfigs, nil

}
